package com.lagou.eduuserboot.com.lagou.controller;

import com.lagou.eduuserboot.entity.User;
import com.lagou.eduuserboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestAction {
    @Autowired
    private UserService userService;

    @GetMapping("hello1")
    public String hello1(){
        System.out.println("你好!");
        return "Hi,teacher";
    }

    @GetMapping("getUserById/{userid}")
    public User getUserById(@PathVariable("userid") Integer userid){
        System.out.println("你好!");
        return userService.getUserById(userid);
    }
}
